Core.Test.registerTest({
	group: "utils",
	name: "Object.get()",
	
	before: function() {
		this.object = {
			array: [1, 2, 3, 4],
			object: {primitiveA: "string", primitiveB: 	true}
		};
	},
	
	get: function( path ) {
		return Object.get( this.object, path );
	},

	"Should get primitive using String path": function() {
		Assert.equal("string", this.get(["object", "primitiveA"]));
	},
	
	"Should get object (containing primitive) using one level shorter path": function() {
		Assert.equal(this.object.object, this.get(["object"]));
	},
	
	"Should get full object with undefined / null path": function() {
		Assert.equal(this.object, this.get([]));
	},
	
	"Should get undefined from not existing path": function() {
		Assert.equal(undefined, this.get(["not", "existing", "path"]));
	},
	
	"Should get array items same way as object properties": function() {
		Assert.equal(1, this.get(["array", "0"]));
		Assert.equal(3, this.get(["array", "2"]));
		
		Assert.equal([1, 2, 3, 4], this.get(["array"]));
	}
});